import request from '@/utils/request'

// 查询用户列表
export function listAdminApi(data) {
  return request.post('/system/admin/list', data)
}

// 查询用户详细
export function infoAdminApi(userId) {
  return request.get('/system/admin/info', { id: userId })
}

// 新增用户
export function addAdminApi(data) {
  return request.post('/system/admin/add', data)
}

// 修改用户
export function editAdminApi(data) {
  return request.post('/system/admin/edit', data)
}

// 删除用户
export function delAdminApi(adminId) {
  return request.post('/system/admin/delete', { id: adminId })
}

// 导出用胡
export function exportAdminApi(data) {
  request.download('/system/admin/export',data)
}

// 用户密码重置
export function resetAdminPwdApi(adminId, password) {
  return request.post('/system/admin/reset-pwd', { id: adminId, password })
}

// 用户状态修改
export function changeAdminStatusApi(adminId, status) {
  return request.post('/system/admin/status', { id: adminId, status: status })
}

// 保存授权角色
export function updateAuthRoleApi(data) {
  return request.post('/system/admin/auth-role', data)
}
